<?php
namespace app\index\controller;

use think\Controller;
use app\index\service\ChargingService;
class Charging extends Controller
{
    private $chargingService;

    /**
     * 依赖注入 Service
     *
     * @param ChargingService $chargingService
     * @author zws
     */
    public function __construct(ChargingService $chargingService)
    {
        parent::__construct();
        $this->chargingService = $chargingService;
    }

    /**
     * 添加充电桩
     * @return \think\response\Json
     * @author zws
     */
    public function add()
    {
        $input = $this->request->input;
        $result = $this->chargingService->add($input);
        return app_response(200, $result);
    }

    /**
     * 查询充电桩
     * @return \think\response\Json
     * @author zws
     */
    public function chargeInfo()
    {
        $input = $this->request->input;
        $result = $this->chargingService->chargeInfo($input);
        return app_response(200, $result);
    }
}